package ACWing.WeeklyRace;
//4783. 多米诺骨牌

import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/12/17 19:12
 */
public class Dominoes {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextLine();
//        char[] chars =new char[n];
//        for (int i = 0; i < n; i++) {
//            chars[i]=sc.next().charAt(0);
//        }
        String s=sc.nextLine();
        char[] chars = s.toCharArray();

        int x=-1,y=-1;//向左和向右
        int x1=0,y1=0;//记录上一个位置
        int sum=0;
//        System.out.println(Arrays.toString(chars));
        for (int i = 0; i < n; i++) {
            if(chars[i]=='L'&&x==-1&&y==-1){
                x=i;
            }
            if(chars[i]=='R'&&x==-1&&y==-1){
                sum=sum+i-0;
                y=i;
            }if(x!=-1&&chars[i]=='R'){
                sum=sum+i-x-1;
                x=-1;
                y=i;
            }
            if(chars[i]=='L'&&y!=-1){
                if((i-y-1)%2==1){
                    sum++;
                }
                y=-1;
                x=i;
            }
            if(i==n-1&&x==-1&&y==-1){
                sum=n;
            }
            if(i==n-1&&x!=-1&&y==-1){
                sum=sum+i-x;
            }

        }
        System.out.println(sum);
    }
}
